package com.qinglei.recoup.system.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.qinglei.recoup.common.domain.CommonRes;
import com.qinglei.recoup.common.exception.RedisConnectException;
import com.qinglei.recoup.system.domain.BedMonitorTime;
import com.qinglei.recoup.system.pojo.BedMonitorTimeVO;
import com.qinglei.recoup.system.pojo.BedMonitorTimeParam;
import com.qinglei.recoup.system.pojo.TimePeriodParam;
import com.qinglei.recoup.system.pojo.MonitorTimeUpdateParam;

import java.util.List;

/**
 * @author syp
 */
public interface BedMonitorTimeService extends IService<BedMonitorTime> {

    /**
     * 添加睡眠监控时间设置
     *
     * @param bedMonitorTimeParam
     * @return
     */
    Integer addBedMonitorTime(BedMonitorTimeParam bedMonitorTimeParam) throws Exception;

    /**
     * 修改睡眠监控时间设置
     *
     * @param param
     * @return
     */
    BedMonitorTime updateBedMonitorTime(MonitorTimeUpdateParam param) throws Exception;

    /**
     * 删除睡眠监控时间设置
     *
     * @param id
     * @return
     */
    BedMonitorTime delBedMonitorTime(Integer id) throws Exception;

    /**
     * 获取指定床位监测时间段列表
     *
     * @param bedId
     * @return
     */
    List<BedMonitorTimeVO> getBedMonitorTimeList(Integer bedId);

    /**
     * 获取下一个监测时间段
     *
     * @param bedId
     * @return
     */
    BedMonitorTimeVO getNextMonitorTime(Integer bedId);

    /**
     * 同步床位所有监测时间段
     *
     * @param monitorTimes
     * @param bedId
     * @throws RedisConnectException
     */
    void syncMonitorTimes(List<TimePeriodParam> monitorTimes, Integer bedId) throws RedisConnectException;
}
